﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.Practices.Unity;
using System.Data.SqlClient;
using System.Data.Objects;

namespace SIGCBI.Repository
{
    public interface IUserRepository
    {
        void RegistraRolaUsuario(string user, string rol);
    }

    public class UserRepository : MasterDataAccess , IUserRepository
    {
        public void RegistraRolaUsuario(string user, string rol)
        {
            if (user != null && rol != null)
            {
                var parmUserName = new SqlParameter("@UserName", user);
                var parmRoleName = new SqlParameter("@RoleName", rol);

                object[] param = new object[2];
                param[0] = parmUserName;
                param[1] = parmRoleName;

                var a = Context.Database.ExecuteSqlCommand("ASIGNAR_ROL_USUARIO  @UserName, @RoleName", param);

            }
        }
    }
}
